{% extends 'demo/base.html' %}
{% load common_extras %}

{% block title %}
    专业开发者社区
{% endblock %}

{% block header %}
    {% include 'demo/header.html' %}
{% endblock %}

{% block main %}
    {% include 'demo/classes.html' %}
    {% if res %}
    <ul class="navs">
        {% for re in res %}
            <li>
                <a href="../../article/{{ re.id }}">
                    <div class="left">
                        <img src="/static/media/{{ re.cover }}" alt="图片溜走了">
                    </div>
                    <div class="right">
                        {# forloop.counter->>当前迭代次数，从1开始#}
                        <h4>{{ forloop.counter }}、{{ re.title }}</h4>
                        <p class="desc">
                            {{ re.desc }}
                        </p>
                        <p class="info">
                            发布时间:{{ re.create_time }}
                        </p>
                    </div>
                </a>
            </li>
            {% if forloop.last %}
                <div class="bottom-info">已经到底了~~</div>
            {% endif %}
        {% endfor %}
    </ul>
{% else %}
    <div class="bottom-info">这是空白页</div>
{% endif %}
{% endblock %}